package com.whg.demo.controller;

import com.whg.demo.conf.TestProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author whg
 * @create 2022/12/5 10:55
 * @description：
 */
@Controller
@RequestMapping("/tl")
public class ThymeleafController {

    @Autowired
    private TestProperties testProperties;

    /**
     * Thymeleaf测试用例
     * @param modelMap
     * @return
     */
    @GetMapping("/test")
    public String getTest(ModelMap modelMap){
        modelMap.addAttribute("setting",testProperties);
        return "admin/info";  //不用加后缀，在配置文件里已经指定了后缀
    }
}
